<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 *  Feed class
 * RSS feed hírekből 
 */
class Feed extends CI_Controller {

    function __construct() {
        // Call the Model constructor
        parent::__construct();
        $this->load->model('hir_model');
    }

    /**
     * RSS 2.0 a feedekhet 
     */
    function hirek_rss() {
        $hirek_config = array(
            'offset' => 0,
            'limit' => 10,
            'order_by' => "hir_id",
            'order_dir' => "desc"
        );
        
        // lekérjük a híreket
        $data['hirek'] = $this->hir_model->get_hirek($hirek_config);
        
        // visszakérjük a view-t
        $hirek_rss = $this->load->view('frontend/api/rss2', $data, true);

        $this->output
                ->set_content_type('application/xml')
                ->set_output($hirek_rss);
    }

}